<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/2/17
 * Time: 20:31
 */

namespace app\admin\validate;


use think\facade\Request;
use think\Exception;
use app\admin\exception\ParameterException;
use think\Validate;

class BaseValidate extends Validate
{
    public function goCheck(){

        $params = Request::param();
        $result = $this->batch()->check($params);
        if(!$result){
           throw new ParameterException(['msg'=>$this->error]);
        }else{
            return true;
        }
    }
}